<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@page import="com.ibt.entity.ProjectEntry,java.util.*" %>
    <%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>.::: Intelligent Bug Tracker :::.</title>

<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

<link href="<%=application.getContextPath() %>/css/bug.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="<%=application.getContextPath()%>/css/jquery-ui-1.8.17.custom.css"/>
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery-1.6.min.js"></script>	
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery-ui-1.8.17.custom.min.js"></script>	
<script language="JavaScript" src="<%=application.getContextPath()%>/js/gen_validatorv4.js" type="text/javascript" ></script>
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery.validate.js"></script>	
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery.validate.min.js"></script>	
<style >
.ui-dialog {
	
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	}
	#bulletinDialog title{
	font-family:Arial, Helvetica, sans-serif;
	font-size:14px;
	font-weight:bold;
	}


</style>
   
<script language="javascript">
    $(document).ready(function(){
    	$('.dropDiv').live('focus',function(){
    		var e2=document.getElementById(this.id);
    		
    	   	
    		var divs=$("#divs").val();
    		//isSpclChar(divs);
    		
    		if(divs!=""){
    		var temp=divs.split(",");
    		
    		
    		if(temp != null){
    			
    			if(e2.options.length>1){
    			for(var i=0;i<temp.length;i++){
    				if(e2.options.length>i+1){
    				if(e2.options[i+1].value!=temp[i]){
    				var o=document.createElement('option');
    				o.value=temp[i];
    				o.text=temp[i];
    				e2.options.add(o);
    				
    				}
    				}else {
    					var o=document.createElement('option');
        				o.value=temp[i];
        				o.text=temp[i];
        				e2.options.add(o);
    				}
    			}
    			}
    				else{
    					for(var i=0;i<temp.length;i++){
    	    				   	    				
    	    				var o=document.createElement('option');
    	    				o.value=temp[i];
    	    				o.text=temp[i];
    	    				e2.options.add(o);
    	    				
    	    				}
    				}
    	    			
    					
    				}
    		}
    			});
    	});
    		
    
    function isSpclChar(divs){
    	
		  // var iChars = "&,?";
		   alert("the divs:"+divs.match("&,?"));
		  /*  if(divs.match(iChars)==-1)
			   {
		 /*   if(document.qfrm.q.value.indexOf(iChars) != -1) { */
		    /*  alert ("The box has special characters. \nThese are not allowed.\n");
		     return false;
		   }  */
		}
    </script>



</head>

<body onload="MM_preloadImages('<%=application.getContextPath() %>/images/home-r.gif','<%=application.getContextPath() %>/images/admin-r.gif','<%=application.getContextPath() %>/images/proj-r.gif','<%=application.getContextPath() %>/images/bug-r.gif')">
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td width="900" height="50" align="left" valign="top" background="<%=application.getContextPath() %>/images/header.gif">      <table width="900" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="341">&nbsp;</td>
          <td width="499" align="left" valign="top"><table width="408" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="93" align="left" valign="top"><a href="<%=application.getContextPath() %>/newbug/showall.do" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','<%=application.getContextPath() %>/images/home-r.gif',1)"><img src="<%=application.getContextPath() %>/images/home.gif" name="Image5" width="92" height="50" border="0" id="Image5" /></a></td>
                <td width="116" align="left" valign="top"><a href="<%=application.getContextPath() %>/jsp/admin.jsp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image6','','<%=application.getContextPath() %>/images/admin-r.gif',1)"><img src="<%=application.getContextPath() %>/images/admin.gif" name="Image6" width="127" height="50" border="0" id="Image6" /></a></td>
                <td width="96" align="left" valign="top"><a href="<%=application.getContextPath() %>/jsp/projectmanager.jsp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image7','','<%=application.getContextPath() %>/images/proj-r.gif',1)"><img src="<%=application.getContextPath() %>/images/proj.gif" name="Image7" width="148" height="50" border="0" id="Image7" /></a></td>
                <td width="103" align="left" valign="top"><a href="<%=application.getContextPath() %>/jsp/bugmanager.jsp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image8','','<%=application.getContextPath() %>/images/bug-r.gif',1)"><img src="<%=application.getContextPath() %>/images/bug-r.gif" name="Image8" width="127" height="50" border="0" id="Image8" /></a></td>
              </tr>
          </table></td>
          <td width="60">&nbsp;</td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td width="900" height="800" align="left" valign="top" background="<%=application.getContextPath() %>/images/header-blue.gif" style="background-position:top; background-repeat:no-repeat"><table width="900" border="0" cellspacing="0" cellpadding="0">
      
      
      <tr>
        <td height="800" align="left" valign="top" background="<%=application.getContextPath() %>/images/bottmobg.gif" style="background-position:bottom; background-repeat:no-repeat"s><table width="900" border="0" cellspacing="0" cellpadding="0">
          
          <tr>
            <td width="57">&nbsp;</td>
            <td width="211" align="left" valign="top"><table width="211" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><img src="<%=application.getContextPath() %>/images/logo.gif" width="211" height="161" /></td>
                </tr>
              <tr>
                <td><img src="<%=application.getContextPath() %>/images/side-hed.gif" width="211" height="44" /></td>
                </tr>
              <tr>
                <td>  <table width="211" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="24" align="left" valign="top" background="<%=application.getContextPath() %>/images/link-bg.gif"><table width="211" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="44">&nbsp;</td>
                              <td width="167" class="serices"><a href="<%=application.getContextPath() %>/newbug/show.do" >Add New Bug</a></td>
                            </tr>
                        </table></td>
                      </tr>
                    <tr>
                      <td height="24" align="left" valign="top" background="<%=application.getContextPath() %>/images/link-bg.gif"><table width="211" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="44">&nbsp;</td>
                              <td width="167" class="serices"><a href="#" onclick="javascript: retriveEnq();">EditBug</a></td>
                            </tr>
                        </table></td>
                      </tr>
                    <tr>
                      <td height="24" align="left" valign="top" background="<%=application.getContextPath() %>/images/link-bg.gif"><table width="211" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="44">&nbsp;</td>
                              <td width="167" class="serices">FixBug</td>
                            </tr>
                        </table></td>
                      </tr>
                    <tr>
                      <td height="24" align="left" valign="top" background="<%=application.getContextPath() %>/images/link-bg.gif"><table width="211" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="44">&nbsp;</td>
                              <td width="167" class="serices"><a href="<%=application.getContextPath() %>/newbug/showall.do">FilterBug</a> </td>
                            </tr>
                        </table></td>
                      </tr>
                        <tr>
                      <td height="24" align="left" valign="top" background="<%=application.getContextPath() %>/images/link-bg.gif"><table width="211" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="44">&nbsp;</td>
                              <td width="167" class="serices">ChangePassword</td>
                            </tr>
                        </table></td>
                      </tr>
                        <tr>
                      <td height="24" align="left" valign="top" background="<%=application.getContextPath() %>/images/link-bg.gif"><table width="211" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="44">&nbsp;</td>
                              <td width="167" class="serices">DeleteBug</td>
                            </tr>
                        </table></td>
                      </tr>
                    <tr>
                      <td align="left" valign="top" background="<%=application.getContextPath() %>/images/bg-bo.gif"><table width="211" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td>&nbsp;</td>
                              <td>&nbsp;</td>
                              <td>&nbsp;</td>
                            </tr>
                        <tr>
                          <td height="300">&nbsp;</td>
                              <td>&nbsp;</td>
                              <td>&nbsp;</td>
                            </tr>
                        <tr>
                          <td>&nbsp;</td>
                              <td>&nbsp;</td>
                              <td>&nbsp;</td>
                            </tr>
                        </table></td>
                      </tr>
                    <tr>
                      <td align="left" valign="top"><img src="<%=application.getContextPath() %>/images/bg-bo-bo.gif" width="211" height="17" /></td>
                      </tr>
                    <tr>
                      <td align="left" valign="top">&nbsp;</td>
                      </tr>
                    <tr>
                      <td align="left" valign="top">&nbsp;</td>
                      </tr>
                  </table></td>
                </tr>
            </table></td>
            <td width="632" align="left" valign="top"><table width="632" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="122" align="left" valign="top"><table width="632" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="53">&nbsp;</td>
                    </tr>
                    <tr>
                      <td height="67" align="right" valign="top"><span class="side-he1"><br />
                        Intelligent Bug Tracker</span> &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td><table width="632" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="5"></td>
                      <td height="5" bgcolor="#C8E2F5"></td>
                      <td height="5" bgcolor="#C8E2F5"></td>
                    </tr>
                    <tr>
                      <td height="2"></td>
                      <td height="2"></td>
                      <td height="2"></td>
                    </tr>
                    <tr>
                      <td width="511" height="5"></td>
                      <td width="121" height="5" bgcolor="#FFFFFF"></td>
                      <td width="121" height="5" bgcolor="#C8E2F5"></td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td align="right">&nbsp;</td>
              </tr>
              <tr>
                <td align="right"><a href="<%=application.getContextPath() %>/login/logout.do"><img src="<%=application.getContextPath() %>/images/signout.gif" /></a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
              </tr>
              <tr>
                <td align="left" valign="top"> <table width="632" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="22">&nbsp;</td>
                        <td width="594">&nbsp;</td>
                        <td width="16">&nbsp;</td>
                      </tr>
                    <tr>
                      <td>&nbsp;</td>
                        <td align="left" valign="top" class="content"><span class="side-he">Bug Entry </span><br />
                          <br /></td>
                        <td> &nbsp;</td>
                      </tr>
                    <tr>
                      <td height="5"></td>
                        <td height="5"><div id="Msg" align="center" class="result_msg" >
    <% 
    	if(request.getAttribute("msg")!=null){
    		out.println(request.getAttribute("msg"));
    	}
    	
    %>
    </div></td>
                        <td height="5"></td>
                      </tr>
                    <tr>
                      <td height="1"></td>
                        <td height="1" bgcolor="#C9E2F4"></td>
                        <td height="1"></td>
                      </tr>
                    <tr>
                      <td>&nbsp;</td>
                        <td align="center" valign="top">
                        <%List<ProjectEntry> projectlist =(List<ProjectEntry>)request.getAttribute("projectlist");%>
                       <form id='grpfrm1' action='<%=application.getContextPath()%>/newbug/add.do'    enctype="multipart/form-data"  method="post">
        <table border="0" align="center" cellpadding="0" cellspacing="0">
       
          <tr>
            <td><table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="113">&nbsp;</td>
                <td width="168">&nbsp;</td>
                <td width="36">&nbsp;</td>
                <td width="131">&nbsp;</td>
                <td width="152">&nbsp;</td>
              </tr>
                 <tr>
                <td class="bugtext">Project Name</td>
                <td> 
                <select name="pname"  id="projlistid"  class="form_select"  >
                
                 <option value="">Select Refrence</option>
         <% 
              if(projectlist!=null){
	      	for(int i=0;i<projectlist.size();i++){ 
	      		System.out.println("the size of the pr list is "+projectlist.size());
	      	%>
           <option  value="<%=projectlist.get(i).getProjectName()%>"><%=projectlist.get(i).getProjectName()%></option>
                   	<%	}
	              	}%>
                </select></td>
                <td>&nbsp;</td>
                <td class="bugtext">Module Name</td>
                <td> <select name="mname"  class="form_select" id="modlist"  >
                 <option value="">Select Refrence</option>
                 </select>                </td>
              </tr>
              <tr>
                <td class="bugtext">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="bugtext">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
                <tr>
                <td class="bugtext">Build Id</td>
                <td> 
                <select name="buildlist"  id="buildlist" onblur="javascript: getBugCode(this)"  class="form_select"  >
                
                 <option value="">Selecast BuildId</option>
                </select></td>
                <td>&nbsp;</td>
                <td class="bugtext">Open Date</td>
                <td><input name="odate" type="text" class="form" id="odate" />                </td>
              </tr>
              <tr>
                <td class="bugtext">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="bugtext">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
                  
              <tr>
                <td   class="bugtext">Bug Code</td>
                <td ><input name="bcode" type="text" class="form" id="bcode" /></td>
                <td>&nbsp;</td>
                <td class="bugtext">PlatForm</td>
                <td valign="bottom"><table><tr><td align="left" valign="bottom"> <input name="platform" type="text" class="form" id="platform" /></td></tr></table></td>
              </tr>
                <tr>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td class="bugtext">Bug Status</td>
                <td><select name="bstatus"  class="form_select" id="bstatus"  >
                 <option value="">Select Status</option>
                 <option value="open">Open</option>
                  <option value="closed">Closed</option>
                   <option value="wont">NotNow</option>
                 </select></td>
                <td>&nbsp;</td>
                <td class="bugtext">Bug Prority</td>
                <td><select name="bugpr"  class="form_select" id="bugpr"  >
                 <option value="">Select Priority</option>
                 <option value="1">1-Must Fix</option>
                  <option value="2">2-Must Fix</option>
                   <option value="3">3-Fix If Time</option>
                   <option value="4">4-Fix in NextVer</option>
                 </select></td>
              </tr>
               <tr>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
          
              <tr>
                <td class="bugtext">&nbsp;Bug Description</td>
                <td>&nbsp;<textarea  rows="1" cols="17" style="" name="bdesc"></textarea> </td>
                <td>&nbsp;</td>
                <td class="bugtext">Due Date</td>
                <td><input name="ddate" type="text" class="form" id="ddate" /></td>
             </tr>
                <tr>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            
                  <tr>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
                <tr>
                <td width="113" height="50" class="bugtext">Steps Reproduce</td>
      <td align="center" valign="middle" width="168"><input type="checkbox" value="" name="sreprocheck" id="sreprocheck" /></td>
      <td colspan="3" align="center"><div id="sreprodiv" style="display: none;"><input type="text"  value=""  class="form" name="steps" id="steps"/></div></td>
                </tr>
              <tr>
                <td>&nbsp;</td></tr>
                 <tr>
                <td height="50" class="bugtext">Stack Trace</td>
      <td align="center" valign="middle" ><input type="checkbox" value="" name="stackcheck" id="stackcheck" /></td>
      <td colspan="3" align="center"><div id="stackdiv" style="display: none;"><input type="file"  value=""  class="form" name="stack" id="stack"/></div></td>
	  </tr>
               <tr>
                <td>&nbsp;</td></tr>
            </table></td>
          </tr>
          <tr>
            <td align="right">
            <table align="center">
            <tr><td>
            <input type="submit"  class="button" value="Save" />
            <input type="reset" class="button" value="Clear" />
            </td></tr></table></td>
          </tr>
          
          <tr>
            <td>&nbsp;</td>
          </tr>
 
        </table>
        </form></td>
        <td>&nbsp;</td>
                      </tr>
                  </table></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="34" bgcolor="#2a44b4">&nbsp;</td>
  </tr>
</table>
<div id="searchEnqDialog" style="display: none;" title="BugEditing">
                     <form action="${pageContext.request.contextPath}/enq/getEnqDetails.do" method="post">
           				 <table>
          					<tr>
           				 		<td align="left">
           				 			<select name="enqdet"  id="enqdetId"></select>
                   				</td>
                   				<td align="right">
								<input class="button" type="submit" value="Edit"/>
								</td>
							</tr>
                    	</table>
                    </form>
                </div>
</body>
</html>
 <script language="javascript">
    $("#projlistid").change(function(){
    	
    	var projname=$("#projlistid").val();
    	 if(projname==null || projname==""){
    		 jAlert("Please Select the Project");
    		 return false;
    	 }
    	 else
    		 {
    	data="pname="+projname;
    	$.ajax({
    		url:"<%=application.getContextPath()%>/newbug/moduleSearch.do",
    		data:data,
    		success:function(res){
    			var e2=document.getElementById('modlist');
    			$('#modlist')
    		    .find('option')
    		    .remove()
    		    .end()
    		   	;
    			var temp=res.split(",");
    			if(temp != null || temp!=""){
    				var o=document.createElement('option');
    				o.value="";
    				o.text="Please Select";
    				e2.options.add(o);
    				for(var i=1;i<temp.length;i++){
    					var o=document.createElement('option');
    					o.value=temp[i];
    					o.text=temp[i];
    					e2.options.add(o);
    				}
    			}
    		}
    	});
    		 }
    });
    </script>
    <script language="javascript">
    $("#modlist").change(function(){
    
    	var modname=$("#modlist").val();
    	var projname=$("#projlistid").val();
    	
    	 if(modname==null ||modname==""){
    		 jAlert("Please Select the module");
    		 return false;
    	 }
    	 else
    		 {
    	data="mname="+modname+"&pname="+projname;
    	$.ajax({
    		url:"<%=application.getContextPath()%>/newbug/buildSearch.do",
    		data:data,
    		success:function(res){
    			var e2=document.getElementById('buildlist');
    			$('#buildlist')
    		    .find('option')
    		    .remove()
    		    .end()
    		    
    		   	;
    			var temp=res.split(",");
    			if(temp != null || temp!=""){
    				var o=document.createElement('option');
    				o.value="";
    				o.text="Please Select";
    				e2.options.add(o);
    				for(var i=1;i<temp.length;i++){
    					var o=document.createElement('option');
    					o.value=temp[i];
    					o.text=temp[i];
    					e2.options.add(o);
    				}
    			}
    		}
    	});
    		 }
    });
    </script>
    <script language="javascript">
    $("#projlistid").change(function(){
    	
    	var projname=$("#projlistid").val();
    	 if(projname==null || projname==""){
    		 jAlert("Please Select the Project");
    		 return false;
    	 }
    	 else
    		 { 
    	data="pname="+projname;
    	// alert(" the Project  name is"+data);
    	$.ajax({
    		url:"<%=application.getContextPath()%>/newbug/moduleSearch.do",
    		data:data,
    		success:function(res){
    			var e2=document.getElementById('modlist');
    			$('#modlist')
    		    .find('option')
    		    .remove()
    		    .end()
    		   	;
    			var temp=res.split(",");
    			if(temp != null || temp!=""){
    				var o=document.createElement('option');
    				o.value="";
    				o.text="Please Select";
    				e2.options.add(o);
    				for(var i=1;i<temp.length;i++){
    					var o=document.createElement('option');
    					o.value=temp[i];
    					o.text=temp[i];
    					e2.options.add(o);
    				}
    			}
    		}
    	});
    		 }
    });
    </script>
    
    <script type="text/javascript">
function getBugCode(builId){
	var buildId=builId.value;
	//alert("build id value"+buildId);
	var modname=$("#modlist").val();
	var projname=$("#projlistid").val();
	var BugCode=projname+"/"+modname+"/"+buildId;
		
		$("#bcode").val(BugCode);
	
}
</script>
 <script type="text/javascript">
	$(function() {
		$( "#odate" ).datepicker({ dateFormat: "dd-mm-yy" },"option", "autoSize", true);
	
		$( "#ddate" ).datepicker({ dateFormat: "dd-mm-yy" },"option", "autoSize", true);
	
		$( "#wargdate" ).datepicker({ dateFormat: "dd-mm-yy" },"option", "autoSize", true);
	
		$( "#waredate" ).datepicker({ dateFormat: "dd-mm-yy" },"option", "autoSize", true);
	});
      $("#sreprocheck").click(function(){
    	  $("#sreprodiv").toggle();
      });
      $("#stackcheck").click(function(){
    	  $("#stackdiv").toggle();
      });
      $("#historyDiv").click(function(){
    	  $("#tableId").toggle();
      });
      
      </script>
 <script type="text/javascript">
function retriveEnq(){
	
	$.ajax({
		url:" <%=application.getContextPath()%>/newbug/showEdit.do",
		mimetype: "text/plain",
		cache:false,
		success: function(res){
		//	alert(res);
			var e2=document.getElementById('enqdetId');
			$('#enqdetId')
		    .find('option')
		    .remove()
		    .end()
		   	;
			var temp=res.split(",");
			//alert(temp[1]);
			var o=document.createElement('option');
			o.value="";
			o.text="Please Select";
			e2.options.add(o);
			if(temp!=null){
				for(var i=0;i<temp.length-1;i++){
					var o=document.createElement('option');
					var t=temp[i].split("/");
					o.value=t[0];
					o.text=t[1];
					e2.options.add(o);
				}
			}
			
			
		}

	});
	
	


	var $dialog = $('#searchEnqDialog').dialog({
                autoOpen: false,
                modal: true,
                width: 460,
                height: 150
              				
            });
 			 
            $dialog.dialog('open');
}
</script>
      